﻿$(document).ready(function () {
    $("table[id^=wgt_]").each(function () {
        if ($(this).attr('id').indexOf('_table') > -1)// by sanal on Jul 04, 2012 to make the widget UI better
        {
            $(this).attr('cellpadding', '0');
            $(this).attr('cellspacing', '0');
        }
    });
    $("#tabs").tabs();
    try {
        var loc = window.location.search.toLowerCase();
        if (loc.indexOf("action=") != -1) {
            var str = loc.substring(loc.indexOf("action=") + 7, loc.length);
            if (str.indexOf("&") != -1)
                str = str.substring(0, str.indexOf("&"));
            if (str == 'data')
                $("#tabs").tabs("option", "active", 1);
            //$("#tabs").tabs('select', 1);  // Commented by 'Imran Gani' on 01-Jul-2013, To handle the latest Jquery UI 1.10.3
        }
    }
    catch (e) {
    }
    handleDashboardChartSize("wgt_", "wgtx", true); // Added by 'Imran Gani' on 13-Aug-2014, for Dashboard widget property
});
function ShowDivForActions(divid) {
    if (document.getElementById(divid) != null) {
        document.getElementById(divid).style.display = "block";
        document.getElementById(divid).focus();
    }
}
function HideDivForActions(divid) {
    if (document.getElementById(divid) != null) {
        document.getElementById(divid).style.display = "none";
    }
}
function UpdateEvent() {
    if (document.getElementById("hfEventTriggered") != null) {
        document.getElementById("hfEventTriggered").value = "1";
    }
}